Factorizing a String into Squares in Linear Time
نویسندگان
چکیده
A square factorization of a string w is a factorization of w in which each factor is a square. Dumitran et al. [SPIRE 2015, pp. 54-66] showed how to find a square factorization of a given string of length n in O(n logn) time, and they posed a question whether it can be done in O(n) time. In this paper, we answer their question positively, showing an O(n)-time algorithm for square factorization in the standard word RAM model with machine word size ω = Ω(logn). We also show an O(n+ (n log2 n)/ω)-time (respectively, O(n logn)-time) algorithm to find a square factorization which contains the maximum (respectively, minimum) number of squares. 1998 ACM Subject Classification F.2.2 Nonnumerical Algorithms and Problems
منابع مشابه
Closed Factorization
A closed string is a string with a proper substring that occurs in the string as a prefix and a suffix, but not elsewhere. Closed strings were introduced by Fici (Proc. WORDS, 2011) as objects of combinatorial interest in the study of Trapezoidal and Sturmian words. In this paper we present algorithms for computing closed factors (substrings) in strings. First, we consider the problem of greedi...
متن کاملComputing All Distinct Squares in Linear Time for Integer Alphabets
Given a string on an integer alphabet, we present an algorithm that computes the set of all distinct squares belonging to this string in time linear to the string length. As an application, we show how to compute the tree topology of the minimal augmented suffix tree in linear time. Asides from that, we elaborate an algorithm computing the longest previous table in a succinct representation usi...
متن کاملA Note on Efficient Computation of All Abelian Periods in a String
We derive a simple efficient algorithm for Abelian periods knowing all Abelian squares in a string. An efficient algorithm for the latter problem was given by Cummings and Smyth in 1997. By the way we show an alternative algorithm for Abelian squares. We also obtain a linear time algorithm finding all “long” Abelian periods. The aim of the paper is a (new) reduction of the problem of all Abelia...
متن کاملVectorial wave-matching mode analysis of integrated optical waveguides
Abstract: For mode fields of integrated optical waveguides with piecewise constant and rectangular permittivity profile, Maxwell’s equations reduce to the twodimensional Helmholtz wave equation, supplemented by continuity requirements on the boundaries between different media. Two basic components of the mode field are expanded into factorizing harmonic or exponential functions, separately on e...
متن کاملAsymptotic Approximations of the Solution for a Traveling String under Boundary Damping
Transversal vibrations of an axially moving string under boundary damping are investigated. Mathematically, it represents a homogenous linear partial differential equation subject to nonhomogeneous boundary conditions. The string is moving with a relatively (low) constant speed, which is considered to be positive. The string is kept fixed at the first end, while the other end is tied with the ...
متن کامل